package org.deschutter.exceptions;

import java.math.BigDecimal;

/**
 * User: Berten De Schutter
 * Date: 08-Jul-2009
 * Time: 14:37:52
 */
public class AddJGPLineException extends Exception {

    String mistake;
    private String x, y, z;
    private Integer eta, amount;
    private String fleetname, scanID;
    private BigDecimal fleetType;

    public AddJGPLineException() {
        super();             // call superclass constructor
        mistake = "unknown";
    }

    public AddJGPLineException(String err) {
        super(err);     // call super class constructor
        mistake = err;  // save message
    }


    public AddJGPLineException(String err, String scanID, BigDecimal fleettype, String x, String y, String z, Integer eta, Integer amount, String fleetname) {
        super(err);     // call super class constructor
        mistake = err;  // save message
        this.scanID = scanID;
        this.fleetType = fleettype;
        this.x = x;
        this.y = y;
        this.z = z;
        this.eta = eta;
        this.amount = amount;
        this.fleetname = fleetname;
    }


    public String getError() {
        if (x == null) {
            return mistake;
        } else {
            return "[ADD JGP LINE EXCEPTION] " + x + ":" + y + ":" + z + ".  Scan: " + scanID + " Eta: " + eta + " Amount: " + amount + " Fleetname: " + fleetname + ". Reason: " + mistake;
        }
    }

    public String getMistake() {
        return mistake;
    }

    public void setMistake(String mistake) {
        this.mistake = mistake;
    }

    public String getX() {
        return x;
    }

    public void setX(String x) {
        this.x = x;
    }

    public String getY() {
        return y;
    }

    public void setY(String y) {
        this.y = y;
    }

    public String getZ() {
        return z;
    }

    public void setZ(String z) {
        this.z = z;
    }

    public Integer getEta() {
        return eta;
    }

    public void setEta(Integer eta) {
        this.eta = eta;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public String getFleetname() {
        return fleetname;
    }

    public void setFleetname(String fleetname) {
        this.fleetname = fleetname;
    }

    public String getScanID() {
        return scanID;
    }

    public void setScanID(String scanID) {
        this.scanID = scanID;
    }

    public BigDecimal getFleetType() {
        return fleetType;
    }

    public void setFleetType(BigDecimal fleetType) {
        this.fleetType = fleetType;
    }
}

